package domain.components;

import com.uqbar.vainilla.DeltaState;
import com.uqbar.vainilla.GameComponent;
import com.uqbar.vainilla.GameScene;
import com.uqbar.vainilla.appearances.Sprite;

public class WeaponsComponent extends GameComponent<GameScene> {
	
	private double expiresOn;
	private double currentSeconds;
	
	public WeaponsComponent(String path){
		super(10, 30);
		this.setZ(10);
		this.expiresOn = 3;
		this.currentSeconds = 0;
		this.setAppearance(Sprite.fromImage("/weapon/"+path+"_select.PNG"));
	}
	
	public void update(DeltaState delta){
		this.currentSeconds += delta.getDelta();
		if (currentSeconds > this.expiresOn){
			this.destroy();
		}
	}
}
